<?php

class Light_Exception extends Exception
{
	public function __construct ($message = null, $code = null, $previous = null)
	{
		parent::__construct($message, $code, $previous);

		Light_Log::write('(' . $code . ') ' . strip_tags($message), 'exceptions');
	}

	public static function errorHandler($errno, $errstr, $errfile, $errline)
	{
		Light_Log::write('(' . $errno . ') ' . $errstr . ' ' . $errfile . ' ' . $errline, 'errors');

		return false;
	}
}